<template>
  <div>
    <el-select v-model="selectedStatus" placeholder="请选择">
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value">
      </el-option>
    </el-select>
  </div>
</template>

<script>
export default {
  name: 'SelectedStatus',
  props: {
    value: {
      type: [String, Number],
      default: undefined
    }
  },
  watch: {
    value(newValue) {
      this.selectedStatus = newValue
    },
    selectedStatus(newValue) {
      this.$emit('change', newValue)
    }
  },
  data() {
    return {
      selectedStatus: undefined,
      options: [
        {
          value: undefined,
          label: '全部'
        },
        {
          value: 1,
          label: '显示'
        },
        {
          value: 0,
          label: '隐藏'
        }
      ]
    }
  }
}
</script>

<style scoped>

</style>
